<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./js/mock.js"></script>
    <script>
      // Date
      const Random = Mock.Random;
      console.log(Random.date(), Random.date("yyyy-mm-dd"));
      console.log(Random.time(), Random.time("A HH:mm:SS"));
      console.log(Random.datetime());
      console.log(Random.now(), Random.now("year"));

      // Random.image( size?, background?, foreground?, format?, text? )
      console.log(
        Random.image(),
        Random.image("200x100"),
        Random.image("200x100", "#FF6600"),
        Random.image("200x100", "#4A7BF7", "Hello"),
        Random.image("200x100", "#50B347", "#FFF", "Mock.js"),
        Random.image("200x100", "#894FC4", "#FFF", "png", "!")
      );

      // Random.dataImage( size?, text? )
      console.log(
        Random.dataImage(),
        Random.dataImage("200x100"),
        Random.dataImage("200x100", "Hello Mock.js!")
      );

      // color
      console.log(
        Random.color(),
        Random.hex(),
        Random.rgb(),
        Random.rgba(),
        Random.hsl()
      );

      // Random.paragraph( min?, max? )
      console.log(
        Random.paragraph(),
        Random.paragraph(2),
        Random.paragraph(1, 3),
        Random.cparagraph(),
        Random.cparagraph(2),
        Random.cparagraph(1, 3)
      );

      // Random.sentence( min?, max? )
      console.log(Random.sentence(), Random.sentence(5), Random.sentence(3, 5));

      // Random.word( min?, max? )
      console.log(Random.word(), Random.word(5), Random.word(3, 5));

      // Random.title( min?, max? )
      console.log(Random.title(), Random.title(5), Random.title(3, 5));

      // Name
      console.log(
        Random.first(),
        Random.last(),
        Random.cfirst(),
        Random.clast()
      );
      // Random.name( middle? )
      console.log(Random.name(), Random.name(true), Random.cname());

      // Web
      console.log(
        Random.url(),
        Random.domain(),
        Random.protocol(),
        Random.tld(),
        Random.email(),
        Random.ip()
      );

      // Address
      console.log(
        Random.region(),
        Random.province(),
        Random.city(),
        Random.city(true),
        Random.county(),
        Random.county(true),
        Random.zip() // 邮编
      );

      // Helper
      console.log(
        Random.capitalize("hello"),
        Random.upper("hello"),
        Random.lower("HELLO"),
        Random.pick(["a", "e", "i", "o", "u"]),
        Random.shuffle(["a", "e", "i", "o", "u"])
      );

      // Miscellaneous
      console.log(
        Random.guid(),
        Random.id(),
        Random.increment(),
        Random.increment(100)
      );

      console.log(
        Mock.mock("@EMAIL"),
        Mock.mock("@CITY(true)"),
        Mock.mock("@cword('李龙好帅', 1, 3)")
      );

      // 扩展方法
      Random.extend({
        constellation(date) {
          const constellations = [
            "白羊座",
            "金牛座",
            "双子座",
            "巨蟹座",
            "狮子座",
            "处女座",
            "天秤座",
            "天蝎座",
            "射手座",
            "魔羯座",
            "水瓶座",
            "双鱼座",
          ];
          return this.pick(constellations);
        },
      });

      console.log(Random.constellation());
      console.log(Mock.mock("@constellation"));
    </script>
  </body>
</html>
